package Controller;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import Service.UserService;
import Service.WatsonImp;

@Controller
public class Danel {

	UserService watson;

	public UserService getWatson() {
		return watson;
	}

	public void setWatson(UserService watson) {
		this.watson = watson;
	}
	
	@RequestMapping("/watson")
    @ResponseBody  
	public String addUser(){
		ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
		WatsonImp watson = (WatsonImp)ac.getBean("watson");
		
		int flag = watson.add0();
		System.out.println("I am running to survival...");
		return " wendy and watson "+flag;
		
	}
	
}
